/*
 * Amazon Ads API - Sponsored Products
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](setting-up/account-setup) topic.<br/><br/> 
 *
 * The version of the OpenAPI document: 2.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.model;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;

/**
 * Report
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-04-12T19:05:39.971406+08:00[Asia/Shanghai]")
public class Report {
  /**
   * Filters the response to include reports with &#x60;stateFilter&#x60; set to one of the values in the comma-delimited list. &#x60;stateFilter&#x60; and &#x60;segment&#x60; cannot be used in the same report request.  &#x60;asins&#x60; report types do not support the use of &#x60;stateFilter&#x60;.
   */
  @JsonAdapter(StateFilterEnum.Adapter.class)
  public enum StateFilterEnum {
    ENABLED("enabled"),
    
    PAUSED("paused"),
    
    ARCHIVED("archived");

    private String value;

    StateFilterEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static StateFilterEnum fromValue(String value) {
      for (StateFilterEnum b : StateFilterEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<StateFilterEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final StateFilterEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public StateFilterEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return StateFilterEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_STATE_FILTER = "stateFilter";
  @SerializedName(SERIALIZED_NAME_STATE_FILTER)
  private StateFilterEnum stateFilter;

  /**
   * The type of campaign. Only required for &#x60;asins&#x60; reports - don&#39;t use with other report types.
   */
  @JsonAdapter(CampaignTypeEnum.Adapter.class)
  public enum CampaignTypeEnum {
    SPONSOREDPRODUCTS("sponsoredProducts");

    private String value;

    CampaignTypeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static CampaignTypeEnum fromValue(String value) {
      for (CampaignTypeEnum b : CampaignTypeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<CampaignTypeEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final CampaignTypeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public CampaignTypeEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return CampaignTypeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_CAMPAIGN_TYPE = "campaignType";
  @SerializedName(SERIALIZED_NAME_CAMPAIGN_TYPE)
  private CampaignTypeEnum campaignType;

  /**
   * A secondary dimension used to further segment certain types of reports. &#x60;stateFilter&#x60; and &#x60;segment&#x60; cannot be used in the same report request. Keyword search term reports only return search terms that have generated at least one click or sale.  **Note**: Search term reports for auto-targeted campaigns created before 11/14/2018 can be accessed from the &#x60;/v2/sp/keywords/report&#x60; resource. Search term reports for auto-targeted campaigns generated on-and-after 11/14/2018 can be accessed from the &#x60;/v2/sp/targets/report&#x60; resource.   | Dimension | Valid report types | Description | |-----------|-------------|-------------| | query | keywords, targets | Segments a report based on customer search term. | | placement | campaigns | Segments a &#x60;campaigns&#x60; report based on the page location where the ad appeared. |
   */
  @JsonAdapter(SegmentEnum.Adapter.class)
  public enum SegmentEnum {
    QUERY("query"),
    
    PLACEMENT("placement");

    private String value;

    SegmentEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static SegmentEnum fromValue(String value) {
      for (SegmentEnum b : SegmentEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<SegmentEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final SegmentEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public SegmentEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return SegmentEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_SEGMENT = "segment";
  @SerializedName(SERIALIZED_NAME_SEGMENT)
  private SegmentEnum segment;

  public static final String SERIALIZED_NAME_REPORT_DATE = "reportDate";
  @SerializedName(SERIALIZED_NAME_REPORT_DATE)
  private String reportDate;

  public static final String SERIALIZED_NAME_METRICS = "metrics";
  @SerializedName(SERIALIZED_NAME_METRICS)
  private String metrics;


  public Report stateFilter(StateFilterEnum stateFilter) {
    
    this.stateFilter = stateFilter;
    return this;
  }

   /**
   * Filters the response to include reports with &#x60;stateFilter&#x60; set to one of the values in the comma-delimited list. &#x60;stateFilter&#x60; and &#x60;segment&#x60; cannot be used in the same report request.  &#x60;asins&#x60; report types do not support the use of &#x60;stateFilter&#x60;.
   * @return stateFilter
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Filters the response to include reports with `stateFilter` set to one of the values in the comma-delimited list. `stateFilter` and `segment` cannot be used in the same report request.  `asins` report types do not support the use of `stateFilter`.")

  public StateFilterEnum getStateFilter() {
    return stateFilter;
  }


  public void setStateFilter(StateFilterEnum stateFilter) {
    this.stateFilter = stateFilter;
  }


  public Report campaignType(CampaignTypeEnum campaignType) {
    
    this.campaignType = campaignType;
    return this;
  }

   /**
   * The type of campaign. Only required for &#x60;asins&#x60; reports - don&#39;t use with other report types.
   * @return campaignType
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The type of campaign. Only required for `asins` reports - don't use with other report types.")

  public CampaignTypeEnum getCampaignType() {
    return campaignType;
  }


  public void setCampaignType(CampaignTypeEnum campaignType) {
    this.campaignType = campaignType;
  }


  public Report segment(SegmentEnum segment) {
    
    this.segment = segment;
    return this;
  }

   /**
   * A secondary dimension used to further segment certain types of reports. &#x60;stateFilter&#x60; and &#x60;segment&#x60; cannot be used in the same report request. Keyword search term reports only return search terms that have generated at least one click or sale.  **Note**: Search term reports for auto-targeted campaigns created before 11/14/2018 can be accessed from the &#x60;/v2/sp/keywords/report&#x60; resource. Search term reports for auto-targeted campaigns generated on-and-after 11/14/2018 can be accessed from the &#x60;/v2/sp/targets/report&#x60; resource.   | Dimension | Valid report types | Description | |-----------|-------------|-------------| | query | keywords, targets | Segments a report based on customer search term. | | placement | campaigns | Segments a &#x60;campaigns&#x60; report based on the page location where the ad appeared. |
   * @return segment
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "A secondary dimension used to further segment certain types of reports. `stateFilter` and `segment` cannot be used in the same report request. Keyword search term reports only return search terms that have generated at least one click or sale.  **Note**: Search term reports for auto-targeted campaigns created before 11/14/2018 can be accessed from the `/v2/sp/keywords/report` resource. Search term reports for auto-targeted campaigns generated on-and-after 11/14/2018 can be accessed from the `/v2/sp/targets/report` resource.   | Dimension | Valid report types | Description | |-----------|-------------|-------------| | query | keywords, targets | Segments a report based on customer search term. | | placement | campaigns | Segments a `campaigns` report based on the page location where the ad appeared. |")

  public SegmentEnum getSegment() {
    return segment;
  }


  public void setSegment(SegmentEnum segment) {
    this.segment = segment;
  }


  public Report reportDate(String reportDate) {
    
    this.reportDate = reportDate;
    return this;
  }

   /**
   * The date for which to retrieve the performance report in YYYYMMDD format. The time zone is specified by the profile used to request the report. If this date is today, then the performance report may contain partial information. Reports are not available for data older than 60 days. For details on data latency, see the service guarantees in the [developer notes](https://advertising.amazon.com/API/docs/en-us/get-started/developer-notes) section.
   * @return reportDate
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "The date for which to retrieve the performance report in YYYYMMDD format. The time zone is specified by the profile used to request the report. If this date is today, then the performance report may contain partial information. Reports are not available for data older than 60 days. For details on data latency, see the service guarantees in the [developer notes](https://advertising.amazon.com/API/docs/en-us/get-started/developer-notes) section.")

  public String getReportDate() {
    return reportDate;
  }


  public void setReportDate(String reportDate) {
    this.reportDate = reportDate;
  }


  public Report metrics(String metrics) {
    
    this.metrics = metrics;
    return this;
  }

   /**
   * A comma-separated list of the metrics to be included in the report.  Each report type supports different metrics. To understand supported metrics for each report type, see [Report types](/API/docs/en-us/concepts/reporting/report-types).
   * @return metrics
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "A comma-separated list of the metrics to be included in the report.  Each report type supports different metrics. To understand supported metrics for each report type, see [Report types](/API/docs/en-us/concepts/reporting/report-types).")

  public String getMetrics() {
    return metrics;
  }


  public void setMetrics(String metrics) {
    this.metrics = metrics;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Report report = (Report) o;
    return Objects.equals(this.stateFilter, report.stateFilter) &&
        Objects.equals(this.campaignType, report.campaignType) &&
        Objects.equals(this.segment, report.segment) &&
        Objects.equals(this.reportDate, report.reportDate) &&
        Objects.equals(this.metrics, report.metrics);
  }

  @Override
  public int hashCode() {
    return Objects.hash(stateFilter, campaignType, segment, reportDate, metrics);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Report {\n");
    sb.append("    stateFilter: ").append(toIndentedString(stateFilter)).append("\n");
    sb.append("    campaignType: ").append(toIndentedString(campaignType)).append("\n");
    sb.append("    segment: ").append(toIndentedString(segment)).append("\n");
    sb.append("    reportDate: ").append(toIndentedString(reportDate)).append("\n");
    sb.append("    metrics: ").append(toIndentedString(metrics)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

